{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting ./MNIST_data/train-images-idx3-ubyte.gz\n",
      "Extracting ./MNIST_data/train-labels-idx1-ubyte.gz\n",
      "Extracting ./MNIST_data/t10k-images-idx3-ubyte.gz\n",
      "Extracting ./MNIST_data/t10k-labels-idx1-ubyte.gz\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import tensorflow as tf\n",
    "\n",
    "from tensorflow.examples.tutorials.mnist import input_data\n",
    "\n",
    "\n",
    "os.environ[\"CUDA_VISIBLE_DEVICES\"] = '0'   #指定第一块GPU可用\n",
    "config = tf.ConfigProto()\n",
    "config.gpu_options.per_process_gpu_memory_fraction = 0.5  # 程序最多只能占用指定gpu50%的显存\n",
    "config.gpu_options.allow_growth = True      #程序按需申请内存\n",
    "sess = tf.Session(config = config)\n",
    "\n",
    "\n",
    "#载入自带数据集\n",
    "mnist = input_data.read_data_sets(\"./MNIST_data/\",one_hot=True)\n",
    "\n",
    " \n",
    "test_data = mnist.train.images[:10].reshape((-1, 784))\n",
    "test_label = mnist.train.labels[:10]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "tf.reset_default_graph()\n",
    "\n",
    "# 输入图片是28*28\n",
    "n_inputs = 28 #输入一行，一行有28个数据\n",
    "max_time = 28 #一共28行\n",
    "lstm_size = 100 #隐层单元\n",
    "n_classes = 10 # 10个分类\n",
    "batch_size = 50 #每批次50个样本\n",
    "n_batch = mnist.train.num_examples // batch_size #计算一共有多少个批次\n",
    "#这里的none表示第一个维度可以是任意的长度\n",
    "## 命名为inputxx\n",
    "x = tf.placeholder(tf.float32,[None,784], name='inputxx')\n",
    "#正确的标签\n",
    "y = tf.placeholder(tf.float32,[None,10])\n",
    "#初始化权值\n",
    "weights = tf.Variable(tf.truncated_normal([lstm_size, n_classes], stddev=0.1))\n",
    "#初始化偏置值\n",
    "biases = tf.Variable(tf.constant(0.1, shape=[n_classes]))\n",
    "#定义RNN网络\n",
    "def RNN(X,weights,biases,name):\n",
    "    # inputs=[batch_size, max_time, n_inputs]\n",
    "    inputs = tf.reshape(X,[-1,max_time,n_inputs])\n",
    "    #定义LSTM基本CELL\n",
    "    lstm_cell = tf.contrib.rnn.BasicLSTMCell(lstm_size)\n",
    "    # final_state[0]是cell state\n",
    "    # final_state[1]是hidden_state\n",
    "    outputs,final_state = tf.nn.dynamic_rnn(lstm_cell,inputs,dtype=tf.float32)\n",
    "    results = tf.nn.softmax(tf.matmul(final_state[1],weights) + biases, name=name)\n",
    "    return results\n",
    "#计算RNN的返回结果  分别命名为output_pre和outputxx\n",
    "prediction= RNN(x, weights, biases, name=\"output_pre\") \n",
    "prediction_labels = tf.argmax(prediction, axis=1, name=\"outputxx\")\n",
    "\n",
    "#损失函数\n",
    "cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=prediction,labels=y))\n",
    "#使用AdamOptimizer进行优化\n",
    "train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)\n",
    "#结果存放在一个布尔型列表中\n",
    "correct_prediction = tf.equal(tf.argmax(y,1),tf.argmax(prediction,1))#argmax返回一维张量中最大的值所在的位置\n",
    "#求准确率\n",
    "accuracy = tf.reduce_mean(tf.cast(correct_prediction,tf.float32))#把correct_prediction变为float32类型\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iter 0, Testing Accuracy= 0.7436\n",
      "Iter 1, Testing Accuracy= 0.863\n",
      "[[  1.24786005e-04   2.64288887e-04   1.99980587e-02   9.71099854e-01\n",
      "    2.49520817e-05   4.18117299e-04   4.52300628e-05   2.42086407e-03\n",
      "    5.13480045e-04   5.09040989e-03]\n",
      " [  1.01817459e-04   3.83407285e-04   3.83723550e-03   9.88258600e-01\n",
      "    2.57151914e-05   2.13995716e-03   2.01782732e-05   9.47472232e-04\n",
      "    9.92877060e-04   3.29281297e-03]\n",
      " [  3.48399131e-04   2.04604992e-04   4.80323331e-04   3.85689083e-04\n",
      "    7.53585398e-01   1.00939283e-02   1.59015658e-03   2.57629585e-02\n",
      "    8.83968198e-04   2.06664503e-01]\n",
      " [  7.20905489e-04   3.76690528e-04   2.52732309e-04   1.07885980e-05\n",
      "    4.16903931e-04   1.82727899e-03   9.95966077e-01   7.53562836e-06\n",
      "    1.71552805e-04   2.49562872e-04]\n",
      " [  1.56430266e-04   9.97897625e-01   3.13562050e-04   2.29505808e-04\n",
      "    6.19993716e-06   1.34421964e-04   6.28091395e-04   2.14157262e-04\n",
      "    3.32128518e-04   8.78727005e-05]\n",
      " [  1.58869650e-03   6.16473480e-05   7.05729530e-04   3.68845271e-04\n",
      "    2.36385153e-03   2.52688807e-02   2.49037659e-03   1.67124399e-05\n",
      "    9.66825604e-01   3.09682247e-04]\n",
      " [  1.20849421e-04   9.97853100e-01   3.40340688e-04   2.16322267e-04\n",
      "    5.81415270e-06   1.52863882e-04   6.03461696e-04   1.74520610e-04\n",
      "    4.70412953e-04   6.22563894e-05]\n",
      " [  9.96607304e-01   2.18044388e-05   1.69412873e-03   6.15992394e-05\n",
      "    1.11111403e-04   8.15759355e-04   4.92727675e-04   7.95795586e-06\n",
      "    1.54268811e-04   3.33291282e-05]\n",
      " [  2.49926816e-04   1.13779119e-04   1.03519496e-03   1.86499371e-03\n",
      "    2.90626660e-02   1.28609594e-02   7.79936847e-04   2.29088566e-03\n",
      "    6.64274965e-04   9.51077402e-01]\n",
      " [  2.85629154e-04   3.60004415e-05   5.13397332e-04   1.68212428e-04\n",
      "    1.36772904e-03   1.29620740e-02   5.39999630e-04   2.27703549e-05\n",
      "    9.83878851e-01   2.25335607e-04]]\n",
      "<class 'numpy.ndarray'>\n",
      "[3 3 4 6 1 8 1 0 9 8]\n",
      "INFO:tensorflow:Froze 4 variables.\n",
      "Converted 4 variables to const ops.\n",
      "__________ok_________\n"
     ]
    }
   ],
   "source": [
    "#初始化\n",
    "res = 0\n",
    "res_pre = 0\n",
    "init = tf.global_variables_initializer()\n",
    "\n",
    "with tf.Session() as sess:\n",
    "    sess.run(init)\n",
    "    for epoch in range(2):\n",
    "        for batch in range(n_batch):\n",
    "            batch_xs,batch_ys =  mnist.train.next_batch(batch_size)\n",
    "            sess.run(train_step,feed_dict={x:batch_xs,y:batch_ys})\n",
    "        acc = sess.run(accuracy,feed_dict={x:mnist.test.images,y:mnist.test.labels})\n",
    "        print (\"Iter \" + str(epoch) + \", Testing Accuracy= \" + str(acc))\n",
    "    preddd = sess.run(prediction, feed_dict={x: test_data, y: test_label})\n",
    "    \n",
    "    res_pre = preddd\n",
    "    print(res_pre)\n",
    "#     array_pre = sess.run(res_pre)\n",
    "#     # 打印其数据类型与其值\n",
    "#     print(type(array_pre))\n",
    "#     print(array_pre)\n",
    "    \n",
    "    prediction_l = tf.argmax(preddd, axis=1)\n",
    "    res = prediction_l\n",
    "    array = sess.run(res)\n",
    "    # 打印其数据类型与其值\n",
    "    print(type(array))\n",
    "    print(array)\n",
    "\n",
    "    graph = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, [\"inputxx\",\"outputxx\",\"output_pre\"])\n",
    "    tf.train.write_graph(graph, '.', 'offlineLSTM.pb', as_text=False)\n",
    "print(\"__________ok_________\")    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 提取feature和label在Java下构建样本并对比验证结果正确性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tensor(\"ArgMax_2:0\", shape=(10,), dtype=int64)\n",
      "(10,)\n",
      "<class 'numpy.ndarray'>\n",
      "[3 3 4 6 1 8 1 0 9 8]\n"
     ]
    }
   ],
   "source": [
    "print(res)\n",
    "print(res.shape)\n",
    "session = tf.Session()\n",
    "# 张量转化为ndarray\n",
    "array = session.run(res)\n",
    "# 打印其数据类型与其值\n",
    "print(type(array))\n",
    "print(array)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "outputxx:0\n"
     ]
    }
   ],
   "source": [
    "print(prediction_labels.name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.00784314  0.55686277  0.98039222  0.20392159  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.08627451  0.59607846  0.99607849  0.99607849  0.33333334  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.\n",
      "  0.09803922  0.55686277  0.99607849  0.99607849  0.75686282  0.11764707\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.01568628  0.57647061  0.99607849  0.99607849  0.57647061  0.02352941\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.5411765   0.99607849  0.99607849  0.59215689  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.50196081  0.99215692  0.99607849  0.57254905  0.01960784  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.\n",
      "  0.21960786  0.92549026  0.99607849  0.59215689  0.00784314  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.72549021  0.99607849  0.69411767  0.10588236  0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.90196085  0.99607849  0.3019608   0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.\n",
      "  0.29411766  0.99607849  0.67058825  0.00392157  0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.61176473  0.99607849  0.34901962  0.          0.          0.          0.\n",
      "  0.          0.          0.          0.00784314  0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.68627453  0.99607849  0.27450982  0.          0.          0.          0.\n",
      "  0.          0.22352943  0.627451    0.73333335  0.07058824  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.\n",
      "  0.06666667  0.94901967  0.99607849  0.27450982  0.          0.          0.\n",
      "  0.04313726  0.84313732  0.97254908  0.99607849  0.99607849  0.62352943\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.08235294  0.99607849  0.99607849  0.27450982  0.          0.\n",
      "  0.34901962  0.80392164  0.99607849  0.99607849  0.99607849  0.99607849\n",
      "  0.68235296  0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.04313726  0.84313732  0.99607849  0.27450982\n",
      "  0.05490196  0.39607847  0.99607849  0.99607849  0.99607849  0.99607849\n",
      "  0.99607849  0.99607849  0.64313728  0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.68627453\n",
      "  0.99607849  0.7843138   0.86666673  0.99607849  0.99607849  0.99607849\n",
      "  0.99607849  0.99607849  0.99607849  0.80392164  0.08627451  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.28627452  0.98431379  0.99607849  0.99607849  0.99607849  0.99607849\n",
      "  0.99607849  0.99607849  0.98823535  0.59607846  0.08627451  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.90196085  0.99607849  0.99607849  0.99607849\n",
      "  0.99607849  0.99215692  0.64313728  0.29803923  0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.90196085  0.99607849  0.61176473\n",
      "  0.43137258  0.04313726  0.03529412  0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.90196085  0.42745101\n",
      "  0.01176471  0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.        ]\n"
     ]
    }
   ],
   "source": [
    "print(test_data[3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0.  0.  0.  0.  0.  0.  1.  0.  0.  0.]\n"
     ]
    }
   ],
   "source": [
    "print(test_label[3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.25098041\n",
      "  0.4784314   0.69411767  0.99607849  0.5529412   0.47450984  0.1254902   0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.3137255   0.50196081  0.89019614  0.69803923\n",
      "  0.44705886  0.77647066  0.99215692  0.99215692  0.99215692  0.99215692\n",
      "  0.95686281  0.51764709  0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.11764707  0.7843138   0.96862751  0.99215692\n",
      "  0.99215692  0.97254908  0.34901962  0.3019608   0.97647065  0.99215692\n",
      "  0.99215692  0.99215692  0.99215692  0.97647065  0.32941177  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.31764707  0.99215692\n",
      "  0.99215692  0.99215692  0.73725492  0.14509805  0.          0.\n",
      "  0.14901961  0.15294118  0.15294118  0.65098041  0.99215692  0.99215692\n",
      "  0.36470589  0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.31764707  0.99215692  0.93725497  0.64705884  0.07843138  0.          0.\n",
      "  0.          0.          0.          0.          0.4039216   0.99215692\n",
      "  0.99215692  0.36470589  0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.08235294  0.40000004  0.34117648  0.          0.          0.\n",
      "  0.          0.          0.          0.07843138  0.65490198  0.94117653\n",
      "  0.99215692  0.96078438  0.29019609  0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.29019609  0.7960785   0.99215692\n",
      "  0.99215692  0.99215692  0.4784314   0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.75294125  0.99215692\n",
      "  0.99215692  0.96470594  0.77647066  0.1137255   0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.30588236  0.97254908\n",
      "  0.99215692  0.97647065  0.41568631  0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.99607849\n",
      "  0.99215692  0.99215692  0.84313732  0.10980393  0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.4784314\n",
      "  0.99607849  0.99607849  0.99607849  0.8588236   0.47450984  0.14901961\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.02352941  0.54509807  0.72941178  0.99215692  0.99215692  0.99215692\n",
      "  0.96078438  0.56862748  0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.03921569  0.54509807  0.91764712\n",
      "  0.99215692  0.99215692  0.92549026  0.15686275  0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.\n",
      "  0.26274511  0.90980399  0.99215692  0.99215692  0.8588236   0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.07058824  0.80392164  0.99215692  0.99215692  0.94117653  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.09019608  0.21176472\n",
      "  0.65490198  0.80392164  0.99215692  0.99215692  0.99215692  0.82745105\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.14509805  0.10980393\n",
      "  0.          0.          0.          0.01960784  0.16078432  0.16078432\n",
      "  0.68627453  0.81176478  0.99215692  0.99215692  0.99215692  0.99215692\n",
      "  0.99215692  0.83529419  0.13333334  0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.\n",
      "  0.60000002  0.95686281  0.87843144  0.63137257  0.63137257  0.63137257\n",
      "  0.66666669  0.99215692  0.99215692  1.          0.99215692  0.99215692\n",
      "  0.99215692  0.96470594  0.88627458  0.52549022  0.13333334  0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.66666669  0.99215692  0.99215692  0.99215692\n",
      "  0.99215692  0.99215692  0.99215692  0.99215692  0.99215692  1.\n",
      "  0.96862751  0.94117653  0.49803925  0.30588236  0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.66666669  0.99215692\n",
      "  0.99215692  0.99215692  0.99215692  0.99215692  0.65882355  0.47058827\n",
      "  0.47058827  0.47450984  0.27058825  0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.          0.          0.          0.          0.          0.\n",
      "  0.          0.        ]\n"
     ]
    }
   ],
   "source": [
    "print(test_data[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0.  0.  0.  1.  0.  0.  0.  0.  0.  0.]\n"
     ]
    }
   ],
   "source": [
    "print(test_label[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
